#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

int main()
{
    int fd = open("./2.txt", O_RDONLY);
    char buf[1024] = {0};
    ssize_t size = read(fd, buf, sizeof(buf)-1);
    while(1){
        sleep(1);
    }
    printf("i am read %dbit, content is %s\n", size, buf);
    close(fd);
    return 0;
}
#if 0
int main()
{
    int fd = open("./1.txt", O_RDWR | O_CREAT, 0664);
    char* arr = "hello 1.txt";
    ssize_t size = write(fd, arr, strlen(arr));
    printf("output %dbit\n", size);
    close(fd);
    return 0;
}
#endif
